<?php
define(LEVEL , -1);
define(CHALLENGE , -2);
define(SURVIVAL , -3);
define(CUSTOM_GAME , -4);
define(AVG_SURVIVAL , -5);
define(AVG_PUZZLE , -6);
define(GAMES_PLAYED , -7);
define(STARS , -8);

define(PRIVATE_KEY, '&*?@$HFWasw4262.!yo');

function getOrder($type, $isPuzzle){
	$order = " ORDER BY ";
	if($type == CHALLENGE)
	{
		$order .= " level DESC, time ASC ";
	}
	else if($type >= 0)//level
	{
		if ($isPuzzle){
			$order .= " time ASC ";
		}
		else {
			$order .= " time DESC ";
		}
	}
	else{
		$order .= " time DESC ";
	}
return $order;
}
